<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="utf-8" />
        <title>README</title>
        <link rel="stylesheet" href="/theme/css/main.css" />

        <!--[if IE]>
            <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
</head>

<body id="index" class="home">
        <header id="banner" class="body">
                <h1><a href="/">PythonTutorials </a></h1>
                <nav><ul>
                    <li><a href="/category/cpp.html">cpp</a></li>
                    <li class="active"><a href="/category/python.html">python</a></li>
                </ul>
                </nav>
        </header><!-- /#banner -->
<section id="content" class="body">
  <article>
    <header>
      <h1 class="entry-title">
        <a href="/README.html" rel="bookmark"
           title="Permalink to README">README</a></h1>
    </header>

    <div class="entry-content">
<footer class="post-info">
        <span>Mon 06 April 2020</span>
<span>| tags: <a href="/tag/python.html">python</a><a href="/tag/progarmming.html">progarmming</a><a href="/tag/excel.html">Excel</a></span>
</footer><!-- /.post-info -->      <blockquote>
<p>One has no future if one couldn't teach themself<a href='#fn1' name='fn1b'><sup>[1]</sup></a>.</p>
</blockquote>
<h1>自学是门手艺</h1>
<blockquote>
<p>没有自学能力的人没有未来</p>
</blockquote>
<p><strong>作者：李笑来</strong></p>
<p>特别感谢<strong>霍炬</strong>（<a href="https://github.com/virushuo">@virushuo</a>）、<strong>洪强宁</strong>（<a href="https://github.com/hongqn">@hongqn</a>) 两位良师诤友在此书写作过程中给予我的巨大帮助！</p>
<div class="highlight"><pre><span></span><span class="c1"># pseudo-code of selfteaching in Python</span>

<span class="k">def</span> <span class="nf">teach_yourself</span><span class="p">(</span><span class="n">anything</span><span class="p">):</span>
    <span class="k">while</span> <span class="ow">not</span> <span class="n">create</span><span class="p">():</span>
        <span class="n">learn</span><span class="p">()</span>
        <span class="n">practice</span><span class="p">()</span>
    <span class="k">return</span> <span class="n">teach_yourself</span><span class="p">(</span><span class="n">another</span><span class="p">)</span>

<span class="n">teach_yourself</span><span class="p">(</span><span class="n">coding</span><span class="p">)</span>
</pre></div>


<blockquote>
<p>有兴趣帮忙的朋友，请先行阅读 <a href="02.proof-of-work.md">如何使用 Pull Request 为这本书校对</a>。</p>
</blockquote>
<h2>目录</h2>
<blockquote>
<ul>
<li><a href="01.preface.md">01.preface（<strong>前言</strong>）</a></li>
<li><a href="02.proof-of-work.md">02.proof-of-work（<strong>如何证明你真的读过这本书？</strong>）</a></li>
<li><a href="Part.1.A.better.teachyourself.md">Part.1.A.better.teachyourself（<strong>为什么一定要掌握自学能力？</strong>）</a></li>
<li><a href="Part.1.B.why.start.from.learning.coding.md">Part.1.B.why.start.from.learning.coding（<strong>为什么把编程当作自学的入口？</strong>）</a></li>
<li><a href="Part.1.C.must.learn.sth.only.by.reading.md">Part.1.C.must.learn.sth.only.by.reading（<strong>只靠阅读习得新技能</strong>）</a></li>
<li><a href="Part.1.D.preparation.for.reading.md">Part.1.D.preparation.for.reading（<strong>开始阅读前的一些准备</strong>）</a></li>
<li><a href="Part.1.E.1.entrance.md">Part.1.E.1.entrance（<strong>入口</strong>）</a></li>
<li><a href="Part.1.E.2.values-and-their-operators.md">Part.1.E.2.values-and-their-operators（<strong>值及其相应的运算</strong>）</a></li>
<li><a href="Part.1.E.3.controlflow.md">Part.1.E.3.controlflow（<strong>流程控制</strong>）</a></li>
<li><a href="Part.1.E.4.functions.md">Part.1.E.4.functions（<strong>函数</strong>）</a></li>
<li><a href="Part.1.E.5.strings.md">Part.1.E.5.strings（<strong>字符串</strong>）</a></li>
<li><a href="Part.1.E.6.containers.md">Part.1.E.6.containers（<strong>数据容器</strong>）</a></li>
<li><a href="Part.1.E.7.files.md">Part.1.E.7.files（<strong>文件</strong>）</a></li>
<li><a href="Part.1.F.deal-with-forward-references.md">Part.1.F.deal-with-forward-references（<strong>如何从容应对含有过多 “过早引用” 的知识？</strong>）</a></li>
<li><a href="Part.1.G.The-Python-Tutorial-local.md">Part.1.G.The-Python-Tutorial-local（<strong>官方教程：The Python Tutorial</strong>）</a></li>
<li><a href="Part.2.A.clumsy-and-patience.md">Part.2.A.clumsy-and-patience（<strong>笨拙与耐心</strong>）</a></li>
<li><a href="Part.2.B.deliberate-practicing.md">Part.2.B.deliberate-practicing（<strong>刻意练习</strong>）</a></li>
<li><a href="Part.2.C.why-start-from-writing-functions.md">Part.2.C.why-start-from-writing-functions（<strong>为什么从函数开始？</strong>）</a></li>
<li><a href="Part.2.D.1-args.md">Part.2.D.1-args（<strong>关于参数（上）</strong>）</a></li>
<li><a href="Part.2.D.2-aargs.md">Part.2.D.2-aargs（<strong>关于参数（下）</strong>）</a></li>
<li><a href="Part.2.D.3-lambda.md">Part.2.D.3-lambda（<strong>化名与匿名</strong>）</a></li>
<li><a href="Part.2.D.4-recursion.md">Part.2.D.4-recursion（<strong>递归函数</strong>）</a></li>
<li><a href="Part.2.D.5-docstrings.md">Part.2.D.5-docstrings（<strong>函数的文档</strong>）</a></li>
<li><a href="Part.2.D.6-modules.md">Part.2.D.6-modules（<strong>保存到文件的函数</strong>）</a></li>
<li><a href="Part.2.D.7-tdd.md">Part.2.D.7-tdd（<strong>测试驱动的开发</strong>）</a></li>
<li><a href="Part.2.D.8-main.md">Part.2.D.8-main（<strong>可执行的 Python 文件</strong>）</a></li>
<li><a href="Part.2.E.deliberate-thinking.md">Part.2.E.deliberate-thinking（<strong>刻意思考</strong>）</a></li>
<li><a href="Part.3.A.conquering-difficulties.md">Part.3.A.conquering-difficulties（<strong>战胜难点</strong>）</a></li>
<li><a href="Part.3.B.1.classes-1.md">Part.3.B.1.classes-1（<strong>类 —— 面向对象编程</strong>）</a></li>
<li><a href="Part.3.B.2.classes-2.md">Part.3.B.2.classes-2（<strong>类 —— Python 的实现</strong>）</a></li>
<li><a href="Part.3.B.3.decorator-iterator-generator.md">Part.3.B.3.decorator-iterator-generator（<strong>函数工具</strong>）</a></li>
<li><a href="Part.3.B.4.regex.md">Part.3.B.4.regex（<strong>正则表达式</strong>）</a></li>
<li><a href="Part.3.B.5.bnf-ebnf-pebnf.md">Part.3.B.5.bnf-ebnf-pebnf（<strong>BNF 以及 EBNF</strong>）</a></li>
<li><a href="Part.3.C.breaking-good-and-bad.md">Part.3.C.breaking-good-and-bad（<strong>拆解</strong>）</a></li>
<li><a href="Part.3.D.indispensable-illusion.md">Part.3.D.indispensable-illusion（<strong>刚需幻觉</strong>）</a></li>
<li><a href="Part.3.E.to-be-thorough.md">Part.3.E.to-be-thorough（<strong>全面 —— 自学的境界</strong>）</a></li>
<li><a href="Part.3.F.social-selfteaching.md">Part.3.F.social-selfteaching（<strong>自学者的社交</strong>）</a></li>
<li><a href="Part.3.G.the-golden-age-and-google.md">Part.3.G.the-golden-age-and-google（<strong>这是自学者的黄金时代</strong>）</a></li>
<li><a href="Part.3.H.prevent-focus-drifting.md">Part.3.H.prevent-focus-drifting（<strong>避免注意力漂移</strong>）</a></li>
<li><a href="Q.good-communiation.md">Q.good-communiation（<strong>如何成为优秀沟通者</strong>）</a></li>
<li><a href="R.finale.md">R.finale（<strong>自学者的终点</strong>）</a></li>
<li><a href="S.whats-next.md">S.whats-next（<strong>下一步干什么？</strong>）</a></li>
<li><a href="T-appendix.editor.vscode.md">T-appendix.editor.vscode（<strong>Visual Studio Code 的安装与配置</strong>）</a></li>
<li><a href="T-appendix.git-introduction.md">T-appendix.git-introduction（<strong>Git 简介</strong>）</a></li>
<li><a href="T-appendix.jupyter-installation-and-setup.md">T-appendix.jupyter-installation-and-setup（<strong>Jupyterlab 的安装与配置</strong>）</a></li>
<li><a href="T-appendix.symbols.md">T-appendix.symbols（<strong>这些符号都代表什么？</strong>）</a></li>
</ul>
</blockquote>
<h2>关于 <code>.ipynb</code> 文件转换为 <code>.md</code> 文件的备注：</h2>
<div class="highlight"><pre><span></span><span class="c1"># 需提前安装 nbconvert 插件，Terminal 下执行：</span>
$ jupyter nbconvert --to markdown *.ipynb

而后将所有 <span class="sb">`</span>.md<span class="sb">`</span> 文件移到 <span class="sb">`</span>markdown/<span class="sb">`</span> 目录之下 —— 除 <span class="sb">`</span>README.md<span class="sb">`</span> 文件之外

<span class="sb">`</span>README.md<span class="sb">`</span> 文件复制一份到 <span class="sb">`</span>markdown/<span class="sb">`</span> 目录之下，而后编辑为当前文件

<span class="c1"># 需使用 VSCode 批量 Find and Replace:</span>
将所有 <span class="o">(</span>https://raw.githubusercontent.com/selfteaching/the-craft-of-selfteaching/master/images/ 替换为 <span class="o">(</span>https://raw.githubusercontent.com/selfteaching/the-craft-of-selfteaching/master/images/
将所有 <span class="o">(</span>Part.1.A.better.teachyourself_files/ 替换为 <span class="o">(</span>https://raw.githubusercontent.com/selfteaching/the-craft-of-selfteaching/master/images/
将所有 <span class="o">(</span>Part.1.E.6.containers_files/ 替换为 <span class="o">(</span>https://raw.githubusercontent.com/selfteaching/the-craft-of-selfteaching/master/images/
将所有 <span class="sb">```</span><span class="se">\n\n</span> 替换为 <span class="sb">```</span><span class="se">\n</span>
将所有 <span class="se">\n\n</span><span class="sb">```</span> 替换为 <span class="se">\n</span><span class="sb">```</span>
将所有 .ipynb<span class="o">)</span> 替换为 .md<span class="o">)</span>

<span class="sb">`</span>Part.1.E.3.controlflow.md<span class="sb">`</span> 文件中有过长的 output 需要编辑
<span class="sb">`</span>Part.1.E.7.files.md<span class="sb">`</span> 文件中有过长的 output 需要编辑
</pre></div>


<hr>
<p>推荐读者在自己的浏览器上安装 <a href="https://github.com/openstyles/stylus">Stylus</a> 这类终端 CSS 定制插件，Chrome/Firefox/Opera 都支持 Stylus 插件。以便拥有更好的阅读体验。以下 gif 图片展示的是使用自定义 css 前后的效果：</p>
<blockquote>
<p><img alt="123" src="https://raw.githubusercontent.com/selfteaching/the-craft-of-selfteaching/master/images/github-markdown-style.gif?raw=true"></p>
</blockquote>
<p>我用的 Stylus 定制 CSS（针对 github.com）是这样的：</p>
<div class="highlight"><pre><span></span><span class="p">.</span><span class="nc">markdown-body</span> <span class="p">{</span><span class="k">font-family</span><span class="p">:</span> <span class="s2">&quot;PingFang SC&quot;</span><span class="p">;}</span>
<span class="nt">strong</span> <span class="p">{</span><span class="k">color</span><span class="p">:</span><span class="mh">#6392BF</span><span class="p">;}</span>
<span class="nt">em</span> <span class="p">{</span><span class="k">color</span><span class="p">:</span> <span class="mh">#A9312A</span><span class="p">;</span> <span class="k">font-style</span><span class="p">:</span> <span class="kc">normal</span> <span class="cp">!important</span><span class="p">;}</span>
<span class="nt">table</span> <span class="p">{</span><span class="k">font-size</span><span class="p">:</span> <span class="mi">95</span><span class="kt">%</span> <span class="cp">!important</span><span class="p">;}</span>


<span class="p">.</span><span class="nc">CodeMirror</span><span class="o">,</span> <span class="nt">pre</span> <span class="p">{</span><span class="k">font-size</span><span class="p">:</span> <span class="mi">90</span><span class="kt">%</span><span class="p">;}</span>
<span class="nt">pre</span> <span class="p">{</span>
    <span class="k">padding</span><span class="p">:</span> <span class="mi">10</span><span class="kt">px</span> <span class="mi">25</span><span class="kt">px</span><span class="p">;</span>
    <span class="k">background-color</span><span class="p">:</span> <span class="mh">#fafafa</span><span class="p">;</span>
    <span class="k">border-left</span><span class="p">:</span> <span class="mi">4</span><span class="kt">px</span> <span class="kc">solid</span> <span class="mh">#dadada</span><span class="p">;</span>
    <span class="k">border-radius</span><span class="p">:</span> <span class="mi">10</span><span class="kt">px</span><span class="p">;</span>
<span class="p">}</span>

<span class="nt">pre</span> <span class="nt">code</span> <span class="p">{</span>
    <span class="k">background-color</span><span class="p">:</span> <span class="mh">#fafafa</span><span class="p">;</span>
<span class="p">}</span>

<span class="nt">h1</span> <span class="nt">code</span><span class="o">,</span>
<span class="nt">h2</span> <span class="nt">code</span><span class="o">,</span>
<span class="nt">h3</span> <span class="nt">code</span><span class="o">,</span>
<span class="nt">h4</span> <span class="nt">code</span><span class="o">,</span>
<span class="nt">p</span> <span class="nt">code</span><span class="o">,</span> 
<span class="nt">li</span> <span class="nt">code</span><span class="o">,</span>
<span class="nt">blockquote</span> <span class="nt">p</span> <span class="nt">code</span><span class="o">,</span> 
<span class="nt">blockquote</span> <span class="nt">li</span> <span class="nt">code</span><span class="o">,</span>
<span class="nt">td</span> <span class="nt">code</span> <span class="p">{</span>
    <span class="k">background-color</span><span class="p">:</span> <span class="mh">#f6f6f6</span><span class="p">;</span>
    <span class="k">font-size</span><span class="p">:</span> <span class="mi">90</span><span class="kt">%</span><span class="p">;</span>
    <span class="k">color</span><span class="p">:</span><span class="mh">#2e2e2e</span><span class="p">;</span>
    <span class="k">padding</span><span class="p">:</span> <span class="mi">4</span><span class="kt">px</span> <span class="mi">4</span><span class="kt">px</span><span class="p">;</span>
    <span class="k">margin</span><span class="p">:</span> <span class="mi">0</span> <span class="mi">8</span><span class="kt">px</span><span class="p">;</span>
    <span class="k">box-shadow</span><span class="p">:</span> <span class="mi">0</span><span class="kt">px</span> <span class="mi">1</span><span class="kt">px</span> <span class="mi">2</span><span class="kt">px</span> <span class="mi">0</span><span class="kt">px</span> <span class="nb">rgba</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mf">0.2</span><span class="p">);</span>
    <span class="k">border-radius</span><span class="p">:</span> <span class="mi">4</span><span class="kt">px</span><span class="p">;</span>
<span class="p">}</span>
<span class="err">}</span>
</pre></div>


<p>我写的内容里，为了重点突出，特别定制了 <code>strong</code> 和 <code>em</code> 两个元素的显示，让它们以不同的颜色展示；又因为中文并不适合斜体展示，所以，把 <code>em</code> 的 <code>font-style</code> 设定为 <code>normal</code>……</p>
<hr>
<p>本书的版权协议为 <a href="https://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh">CC-BY-NC-ND license</a>。</p>
<p><img alt="CC-BY-NC-ND" src="https://raw.githubusercontent.com/selfteaching/the-craft-of-selfteaching/master/images/CC-BY-NC-ND.png?raw=true"></p>
<hr>
<p><strong>脚注</strong></p>
<p><a name='fn1'>[1]</a>：<a href="https://en.oxforddictionaries.com/usage/themselves-or-themself">'Themselves' or 'themself'?-- Oxford Dictionary</a></p>
<p><a href='#fn1b'><small>↑Back to Content↑</small></a></p>
    </div><!-- /.entry-content -->

  </article>
</section>
        <section id="extras" class="body">
                <div class="blogroll">
                        <h2>blogroll</h2>
                        <ul>
                            <li><a href="http://getpelican.com/">Pelican</a></li>
                            <li><a href="http://python.org/">Python.org</a></li>
                            <li><a href="http://jinja.pocoo.org/">Jinja2</a></li>
                            <li><a href="#">You can modify those links in your config file</a></li>
                        </ul>
                </div><!-- /.blogroll -->
                <div class="social">
                        <h2>social</h2>
                        <ul>

                            <li><a href="#">You can add links in your config file</a></li>
                            <li><a href="#">Another social link</a></li>
                        </ul>
                </div><!-- /.social -->
        </section><!-- /#extras -->

        <footer id="contentinfo" class="body">
                <p>Powered by <a href="http://www.maxiaoan.com/">Maxiaoan</a></p>
        </footer><!-- /#contentinfo -->

</body>
</html>